package com.ugoodtech.mdcc.client.exception;

import lombok.Data;

/**
 * Created by Lance on 2019-09-27.
 *
 * @author Lance Li
 */
@Data
public class ExcelResolveException extends CommonException implements CommonError{

  public ExcelResolveException(int row, int column, String errorValue){
    super();
    this.row = row;
    this.column = column;
    this.errorValue = errorValue;
  }

  /**
   * 错误所在列
   */
  private Integer row;
  /**
   * 错误所在行
   */
  private Integer column;
  /**
   * 错误数据
   */
  private String errorValue;

  @Override
  public String getMessage() {
    StringBuffer stringBuffer = new StringBuffer();
    stringBuffer.append("第").append(row).append("行第").append(column).append("列数据有误,")
        .append("'请输入正确的内容");
    return stringBuffer.toString();
  }

  @Override
  public String getErrCode() {
    return "10002";
  }

  @Override
  public String getErrMsg() {
    return getMessage();
  }

  @Override
  public String getDetailErrMsg() {
    return getMessage();
  }
}
